home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / pascal / window40.zip / WNDW40-.PAS < prev    next >
Pascal/Delphi Source File  |  1987-12-12  |  25KB  |  545 lines

  1. { =========================================================================== }
  2. { Wndw40-.pas - unit for random-access, multi-level windows ver 4.0, 12-12-87 }
  3. {                                                                             }
  4. { This file has a partial code listing for serial and random access,          }
  5. { multi-level windows.  It works on any IBM or compatible including PCjr,     }
  6. { IBM 3270 PC, and the PS/2 systems, in any video mode.  It uses QWIK40.TPU   }
  7. { for fast screen writing on any video page.                                  }
  8. {  (c) James H. LeMay 1987                                                    }
  9. { =========================================================================== }
  10.  
  11. {$R-,S-,I-,D-,T-,F-,V-,B-,N-,L+ }
  12.  
  13. UNIT Wndw;
  14.  
  15. INTERFACE
  16.  
  17. USES Crt,Qwik,WndwVars;
  18.  
  19. { -- Basic Window Utilities -- }
  20. function  Attr            (Foreground,Background: byte): byte;
  21. procedure Qbox            (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  22.                            BrdrSel: Borders);
  23. procedure RestoreTurboWindow;
  24. procedure InitWindow      (Wattr: integer; ClearScr: boolean);
  25. function  HeapOK          (NumOfBytes: word): boolean;
  26. procedure SetWindowModes  (SumOfAllModes: byte);
  27. procedure MakeWindow      (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  28.                            BrdrSel: Borders; WindowName: WindowNames);
  29. procedure PartitionWindow (Partition: DirType; WindowRowOrCol: byte);
  30. procedure PartitionCross  (WindowRow, WindowCol: byte);
  31. procedure RemoveWindow;
  32. procedure TitleWindow     (TopOrBottom,Justify: DirType; Title: string);
  33. procedure ClearTitle      (TopOrBottom: DirType);
  34. procedure ClearWindow;
  35. procedure ScrollWindow    (RowBegin,RowEnd: byte; Dir: DirType);
  36.  
  37. { -- Window management utilities -- }
  38. procedure HideWindow;
  39. procedure ShowWindow      (WindowName: WindowNames);
  40. procedure MoveWindow      (Dir: DirType; NumOfChars: byte);
  41. function  GetLevelIndex   (WindowName: WindowNames): byte;
  42. procedure AccessWindow    (WindowName: WindowNames);
  43.  
  44. IMPLEMENTATION
  45. const
  46.   NoShadow         = $00;
  47.   BothShadows      = $0C;  { ShadowLeft+ShadowRight }
  48.   FixedOrPermModes = $03;  { FixedMode+PermMode }
  49.  
  50. { =========================================================================== }
  51. { NAME: Attr                                               ver 4.0,  12-12-87 }
  52. { DESCRIPTION: Converts Turbo color constants into an attribute and masks     }
  53. {              any accidental blink bit.  However, the use of the new         }
  54. {              background colors constants in WNDWVARS.PAS is recommended     }
  55. {              in lieu of this function.                                      }
  56. { PARAMETERS:  ForeGround - Color of text foreground                          }
  57. {              BackGround - Color of text background                          }
  58. { =========================================================================== }
  59. function Attr;  { (Foreground,Background: byte): byte; }
  60. begin
  61.   Attr := ((BackGround shl 4) + ForeGround) and $7F;
  62. end;
  63.  
  64. { =========================================================================== }
  65. { NAME: RestoreTurboWindow                                  ver 4.0, 12-12-87 }
  66. { DESCRIPTION:  Restores the Turbo window, attribute, cursor location,        }
  67. {               and window identification for the top Level Index.            }
  68. { =========================================================================== }
  69. procedure RestoreTurboWindow;
  70. begin
  71.   with TopWndwStat do
  72.     begin
  73.       TextAttr:=WSWattr;    { Turbo's Attribute }
  74.       if VideoPage=0 then
  75.         if WSbrdr=NoBrdr then
  76.              window (WScol,WSrow,WScol2,WSrow2)
  77.         else window (succ(WScol),succ(WSrow),pred(WScol2),pred(WSrow2));
  78.       GotoRC (WSwhereR,WSwhereC);
  79.     end
  80. end;
  81.  
  82. { =========================================================================== }
  83. { NAME: InitWindow                                          ver 4.0, 12-12-87 }
  84. { DESCRIPTION:  Initializes the window variables.  Run this routine first!    }
  85. { PARAMETERS:                                                                 }
  86. {       Wattr    - Starting window attribute (0-255)                          }
  87. {       ClearScr - Set to true if you want the screen initially cleared       }
  88. { =========================================================================== }
  89. procedure InitWindow;  { (Wattr: integer; ClearScr: boolean); }
  90. begin
  91.   CheckSnow:=Qsnow;
  92.   LI:=0;                          { Current Level Index }
  93.   HLI:=MaxWndw+1;                 { Hidden window Level Index }
  94.   with TopWndwStat,Margins do     { Set top level stats }
  95.     begin
  96.       WSrow   := 1;           WSWattr  := Wattr;
  97.       WScol   := 1;           WSBattr  := Wattr;
  98.       WSrows  := CRTrows;     WSbrdr   := NoBrdr;
  99.       WScols  := CRTcols;     WSname   := Window0;
  100.       WSrow2  := CRTrows;     WSwhereR := 1;
  101.       WScol2  := CRTcols;     WSwhereC := 1;
  102.       WSmodes := PermMode;
  103.       ULbytes := 0;
  104.       WndwStat[0]  := TopWndwStat;    { Save a copy }
  105.       LeftMargin   := WScol;
  106.       RightMargin  := WScol2;
  107.       TopMargin    := WSrow;
  108.       BottomMargin := WSrow2;
  109.       WindowModes  := 0;
  110.       case SystemID of
  111.         $FC,$F8: ZoomDelay:=18;  { 80286 or 80386 machines }
  112.       else ZoomDelay:=12;
  113.       end;
  114.       RestoreTurboWindow;
  115.       if ClearScr then
  116.         Qfill (1,1,CRTrows,CRTcols,Wattr,' ');
  117.     end;
  118. end;
  119.  
  120. { =========================================================================== }
  121. { NAME: SetWindowModes                                      ver 4.0, 12-12-87 }
  122. { DESCRIPTION:  Checks and set the variable WindowModes.                      }
  123. { PARAMETERS:   SumOfAllModes - A sum of all the modes added together.        }
  124. { =========================================================================== }
  125. procedure SetWindowModes; { (SumOfAllModes: byte); }
  126. begin
  127.   { -- Turn off HideMode -- }
  128.   WindowModes:=SumOfAllModes and ($FF-HideMode);
  129.   { -- if both shadows, clear ShadowLeft -- }
  130.   if (WindowModes and BothShadows)=BothShadows then
  131.     WindowModes:=WindowModes-ShadowLeft;
  132. end;
  133.  
  134. { =========================================================================== }
  135. { NAME: HeapOK                                              ver 4.0, 12-12-87 }
  136. { DESCRIPTION:  Checks for enough memory on the heap used by MakeWindow.      }
  137. { PARAMETERS:   NumOfBytes - number of bytes needed on the heap               }
  138. { =========================================================================== }
  139. function HeapOK;  { (NumOfBytes: word): boolean; }
  140. begin
  141.   if maxavail<NumOfBytes then
  142.     begin
  143.       ProgrammingError (1);
  144.       HeapOK := false
  145.     end
  146.   else HeapOK := true
  147. end;
  148.  
  149. { =========================================================================== }
  150. { NAME: Qbox                                               ver 4.0,  12-12-87 }
  151. { DESCRIPTION: Writes a window with optional border.                          }
  152. { PARAMETERS:  See MakeWindow.                                                }
  153. { =========================================================================== }
  154. procedure Qbox; {  (Row,Col,Rows,Cols: byte;
  155.                     Wattr,Battr: integer; BrdrSel: Borders); }
  156. var  Row2,Col2: byte;
  157. begin
  158.   if (Rows>=2) and (Cols>=2) then
  159.     begin
  160.       Row2:=pred(Row+Rows);
  161.       Col2:=pred(Col+Cols);
  162.       if BrdrSel<>NoBrdr then
  163.         with Brdr[BrdrSel] do
  164.           begin
  165.             Qwrite (     Row ,     Col               ,Battr,TL);
  166.             Qfill  (     Row ,succ(Col),1     ,Cols-2,Battr,TH);
  167.             Qwrite (     Row ,     Col2              ,Battr,TR);
  168.             Qfill  (succ(Row),     Col ,Rows-2,1     ,Battr,LV);
  169.             Qfill  (succ(Row),     Col2,Rows-2,1     ,Battr,RV);
  170.             Qwrite (     Row2,     Col               ,Battr,BL);
  171.             Qfill  (     Row2,succ(Col),1     ,Cols-2,Battr,BH);
  172.             Qwrite (     Row2,     Col2              ,Battr,BR);
  173.             Qfill  (succ(Row),succ(Col),Rows-2,Cols-2,Wattr,' ')
  174.           end
  175.       else Qfill  (Row,Col,Rows,Cols,Wattr,' ');
  176.   end;
  177. end;
  178.  
  179. { =========================================================================== }
  180. { NAME: ZoomQbox (Near procedure)                          ver 4.0,  12-12-87 }
  181. { DESCRIPTION: Creates zoom effect when producing a blank window.             }
  182. { =========================================================================== }
  183. procedure ZoomQbox;
  184. var
  185.   r1,r2,ColRatio: byte;
  186.   c1,c2:          integer;
  187. begin
  188.   with TopWndwStat do
  189.     begin
  190.       r1 := WSrow  + pred((WSrows shr 1));
  191.       r2 := WSrow2 -      (WSrows shr 1);
  192.       c1 := WScol  + pred((WScols shr 1));
  193.       c2 := WScol2 -      (WScols shr 1);
  194.       ColRatio := succ(WScols div WSrows);
  195.       if ColRatio>4 then ColRatio:=4;
  196.       repeat
  197.         if r1>WSrow  then r1:=pred(r1);
  198.         if r2<WSrow2 then r2:=succ(r2);
  199.         if c1>WScol  then c1:=c1-ColRatio;
  200.         if c1<WScol  then c1:=WScol;
  201.         if c2<WScol2 then c2:=c2+ColRatio;
  202.         if c2>WScol2 then c2:=WScol2;
  203.         Qbox (r1,c1,succ(r2-r1),succ(c2-c1),WSWattr,WSBattr,WSbrdr);
  204.         if not Qsnow then delay (ZoomDelay);
  205.       until  (c2=WScol2) and (r2=WSrow2);
  206.     end;
  207. end;
  208.  
  209. { =========================================================================== }
  210. { NAME: MakeWindow                                          ver 4.0, 12-12-87 }
  211. { DESCRIPTION:  Creates a window on your screen.                              }
  212. { PARAMETERS:                                                                 }
  213. {       Row        - First row        (1 - Screen limit)                      }
  214. {       Col        - First column     (1 - Screen limit)                      }
  215. {       Rows       - # of rows        (1 - Screen limit)                      }
  216. {       Cols       - # of columns     (1 - Screen limit)                      }
  217. {       Wattr      - Window attribute (-1 - 255)                              }
  218. {       Battr      - Border attribute (-1 - 255)                              }
  219. {       BrdSel     - Border selection (NoBrdr - UserBrdr2)                    }
  220. {       WindowName - User assigned unique window identification name          }
  221. { =========================================================================== }
  222. procedure MakeWindow; {  (Row,Col,Rows,Cols: byte; Wattr,Battr: integer;
  223.                           BrdrSel: Borders; WindowName: WindowNames); }
  224. var
  225.   r1,r2,c1,c2,ColRatio,ShadowDir: byte;
  226.   UnderlayBytes:                  word;
  227. {}procedure ShadowFill (VertCol,HorizCol: byte);
  228. {}begin
  229. {}  with TopWndwStat do
  230. {}    begin
  231. {}      Qfill (succ(WSrow) ,VertCol ,pred(WSrows),     2,black,' ');
  232. {}      Qfill (succ(WSrow2),HorizCol,           1,WScols,black,' ')
  233. {}    end
  234. {}end;
  235. begin
  236.   if LI=pred(HLI) then ProgrammingError(2)
  237.   else
  238.   begin
  239.     c1:=Col;  c2:=Cols+2;  r2:=succ(Rows);   { Assume ShadowRight }
  240.     ShadowDir := WindowModes and BothShadows;
  241.     case ShadowDir of
  242.       ShadowLeft:  c1:=Col-2;
  243.       NoShadow:    begin  c2:=Cols; r2:=Rows;  end;  { No shadow }
  244.     end;
  245.     UnderlayBytes := r2*c2 shl 1;     { Memory size needed to store display }
  246.     { Short-circuit boolean evaluation required on next line, because    }
  247.     { the heap should NOT be checked in PermMode or an error may result. }
  248.     if odd(WindowModes) or HeapOK(UnderlayBytes) then
  249.       begin
  250.         TopWndwStat.WSwhereR := WhereR;   { Old absolute cursor coordinates }
  251.         TopWndwStat.WSwhereC := WhereC;
  252.         WndwStat[LI]:=TopWndwStat;        { Save all stats }
  253.         inc(LI);                          { Go to next higher window level }
  254.         with TopWndwStat do
  255.           begin
  256.             { Store all variables for this window }
  257.             WSrow   := Row;                  WSname   := WindowName;
  258.             WScol   := Col;                  WSwhereR := succ(WSrow);
  259.             WSrows  := Rows;                 WSwhereC := succ(WScol);
  260.             WScols  := Cols;                 WSmodes  := WindowModes;
  261.             WSrow2  := WSrow+pred(WSrows);   ULcol    := c1;
  262.             WScol2  := WScol+pred(WScols);   ULcols   := c2;
  263.             WSWattr := Wattr;                ULrows   := r2;
  264.             WSBattr := Battr;                ULbytes  := UnderlayBytes;
  265.             WSbrdr  := BrdrSel;
  266.             if WSbrdr=NoBrdr then
  267.               begin
  268.                 dec (WSwhereR);
  269.                 dec (WSwhereC);
  270.               end;
  271.             if not odd(WSmodes) then
  272.               begin
  273.                 GetMem (ULptr,ULbytes);  { Reserve heap space }
  274.                 QstoreToMem (WSrow,ULcol,ULrows,ULcols,ULptr^);
  275.               end;
  276.             if (WindowModes and ZoomMode)=ZoomMode then
  277.                  ZoomQbox
  278.             else Qbox (WSrow,WScol,WSrows,WScols,Wattr,Battr,BrdrSel);
  279.             if ShadowDir>NoShadow then
  280.               if ShadowDir=ShadowLeft then
  281.                    ShadowFill (WScol-2     ,WScol-2)
  282.               else ShadowFill (succ(WScol2),WScol+2);
  283.           end;  { with }
  284.         WndwStat[LI]:=TopWndwStat;    { Save a copy of the stats }
  285.         RestoreTurboWindow;
  286.       end; { OK }
  287.   end;     { if LI }
  288. end;
  289.  
  290. { =========================================================================== }
  291. { NAME: PartitionWindow                                     ver 4.0, 12-12-87 }
  292. { DESCRIPTION: Places a partition of the same type as the border              }
  293. { PARAMETERS:  Partition - Horiz or Vertical partition                        }
  294. {              WindowRowOrCol - Location relative to the TP window            }
  295. { =========================================================================== }
  296. procedure PartitionWindow; { (Partition: DirType; WindowRowOrCol: byte);}
  297. var  Row,Col: byte;
  298. begin
  299.   with TopWndwStat do
  300.     if WSbrdr<>NoBrdr then
  301.       with Brdr[WSbrdr] do
  302.         if Partition=Vertical then
  303.           begin
  304.             Col:=WScol+WindowRowOrCol;
  305.             Qwrite (     WSrow ,Col,           WSBattr,PT);
  306.             Qfill  (succ(WSrow),Col,WSrows-2,1,WSBattr,PV);
  307.             Qwrite (     WSrow2,Col,           WSBattr,PB);
  308.           end
  309.         else
  310.           begin
  311.             Row:=WSrow+WindowRowOrCol;
  312.             Qwrite (Row,     WScol ,           WSBattr,PL);
  313.             Qfill  (Row,succ(WScol),1,WScols-2,WSBattr,PH);
  314.             Qwrite (Row,     WScol2,           WSBattr,PR);
  315.           end;
  316. end;
  317.  
  318. { =========================================================================== }
  319. { NAME: PartitionCross                                      ver 4.0, 12-12-87 }
  320. { DESCRIPTION: Places a cross at the intersection of two partitions           }
  321. { PARAMETERS:  WindowRow,WindowCol - Location relative to the TP window       }
  322. { =========================================================================== }
  323. procedure PartitionCross; { (WindowRow, WindowCol: byte);}
  324. begin
  325.   with TopWndwStat do
  326.     if WSbrdr<>NoBrdr then
  327.       Qwrite (WSrow+WindowRow,WScol+WindowCol,WSBattr,Brdr[WSbrdr].PC);
  328. end;
  329.  
  330. { =========================================================================== }
  331. { NAME: RemoveWindow                                        ver 4.0, 12-12-87 }
  332. { DESCRIPTION: Removes the top level window from the screen.  To get          }
  333. {              back to the original screen, there must be as many             }
  334. {              RemoveWindow(s) as there are MakeWindow(s).                    }
  335. { =========================================================================== }
  336. procedure RemoveWindow;
  337. begin
  338.   with TopWndwStat do
  339.     if odd(WSmodes) then ProgrammingError (3)  { Tests for PermMode }
  340.     else
  341.       begin
  342.         QstoreToScr (WSrow,ULcol,ULrows,ULcols,ULptr^);
  343.         FreeMem (ULptr,ULbytes);
  344.         WndwStat[LI]:=TopWndwStat;  { Save any changes }
  345.         dec (LI);                   { Go to next lower level }
  346.         TopWndwStat:=WndwStat[LI];  { Make a copy of the new stats }
  347.         RestoreTurboWindow;
  348.       end
  349. end;
  350.  
  351. { =========================================================================== }
  352. { NAME: TitleWindow                                         ver 4.0, 12-12-87 }
  353. { DESCRIPTION: Places a title on the top or bottom border of a window.        }
  354. { PARAMETERS:  Justify - justification of the title                           }
  355. {              Title - Optional title of the window                           }
  356. { =========================================================================== }
  357. procedure TitleWindow;  { (TopOrBottom,Justify: DirType; Title: string); }
  358. var  R: byte;
  359. begin
  360.   with TopWndwStat do
  361.     begin
  362.       if TopOrBottom=Bottom then
  363.            R:=WSrow2
  364.       else R:=WSrow;
  365.       case Justify of
  366.         Left:   Qwrite  (R,WScol+2                   ,-1,Title);
  367.         Right:  Qwrite  (R,WScol2-succ(length(Title)),-1,Title);
  368.       else      QwriteC (R,WScol,WScol2              ,-1,Title);
  369.       end;
  370.     end;
  371. end;
  372.  
  373. { =========================================================================== }
  374. { NAME: ClearTitle                                          ver 4.0, 12-12-87 }
  375. { DESCRIPTION: Clears the title on the top or bottom border of a window.      }
  376. { PARAMETERS:  TopOrBottom - All of the top or bottom line                    }
  377. { =========================================================================== }
  378. procedure ClearTitle;  { (TopOrBottom: DirType); }
  379. var
  380.   Row:      byte;
  381.   BrdrPart: char;
  382. begin
  383.   with TopWndwStat do
  384.     begin
  385.       if TopOrBottom=Bottom then
  386.            Row:=WSrow2
  387.       else Row:=WSrow;
  388.       if WSbrdr=NoBrdr then
  389.         Qfill (Row,WScol,1,WScols,-1,' ')
  390.       else
  391.         begin
  392.           if TopOrBottom=Bottom then
  393.                BrdrPart:=Brdr[WSbrdr].BH
  394.           else BrdrPart:=Brdr[WSbrdr].TH;
  395.           Qfill (Row,succ(WScol),1,WScols-2,-1,BrdrPart);
  396.         end;
  397.     end;
  398. end;
  399.  
  400. { =========================================================================== }
  401. { NAME: ClearWindow                                         ver 4.0, 12-12-87 }
  402. { DESCRIPTION: Same as ClrScr, but works on any video page.                   }
  403. { =========================================================================== }
  404. procedure ClearWindow;
  405. begin
  406.   with TopWndwStat do
  407.     if WSbrdr=NoBrdr then
  408.       begin
  409.         Qfill  (WSrow,WScol,WSrows,WScols,WSWattr,' ');
  410.         GotoRC (WSrow,WScol);
  411.       end
  412.     else
  413.       begin
  414.         Qfill  (succ(WSrow),succ(WScol),WSrows-2,WScols-2,WSWattr,' ');
  415.         GotoRC (succ(WSrow),succ(WScol));
  416.       end;
  417. end;
  418.  
  419. { =========================================================================== }
  420. { NAME: ScrollWindow                                        ver 4.0, 12-12-87 }
  421. { DESCRIPTION: Scrolls a number of rows in a window.  Using a little          }
  422. {              thought, you can see how this is better than the InsLine       }
  423. {              and DelLine procedures.  Flicker-free and works on any page.   }
  424. { PARAMETERS:  RowBegin,RowEnd - Window relative rows to be affected          }
  425. {              Dir             - 'Up' or 'Down'                               }
  426. { =========================================================================== }
  427. procedure ScrollWindow;  { (RowBegin,RowEnd: byte; Dir: DirType); }
  428. var  BrdrWidth,R,C,Rs,Cs: byte;
  429. {}procedure Qscroll (MemRowBegin,ScrRowBegin,FillRow: byte);
  430. {}var Temp:     WordArrayPtrType;
  431. {}    TempBytes: word;
  432. {}begin
  433. {}  TempBytes := Rs*Cs shl 1;
  434. {}  if HeapOK(TempBytes) then
  435. {}  begin
  436. {}    GetMem      (Temp,TempBytes);
  437. {}    QstoreToMem (MemRowBegin,C,Rs,Cs,Temp^);
  438. {}    QstoreToScr (ScrRowBegin,C,Rs,Cs,Temp^);
  439. {}    Qfill       (FillRow    ,C, 1,Cs,TopWndwStat.WSWattr,' ');
  440. {}    FreeMem     (Temp,TempBytes);
  441. {}  end
  442. {}end;
  443. begin
  444.   with TopWndwStat do
  445.     begin
  446.       if WSbrdr=NoBrdr then
  447.            BrdrWidth:=0
  448.       else BrdrWidth:=1;
  449.       R  := WSrow+BrdrWidth+pred(RowBegin);
  450.       C  := WScol+BrdrWidth;
  451.       Rs := RowEnd-RowBegin;
  452.       Cs := WScols-(BrdrWidth shl 1);
  453.       case Dir of
  454.         Up:   Qscroll (succ(R),     R ,R+Rs);
  455.         Down: Qscroll (     R ,succ(R),R   );
  456.       end
  457.     end
  458. end;
  459.  
  460. { =========================================================================== }
  461. { NAME: HideWindow                                          ver 4.0, 12-12-87 }
  462. { DESCRIPTION: Hides the top window on the screen and saves the               }
  463. {              contents for later display.                                    }
  464. { =========================================================================== }
  465. procedure HideWindow;
  466. begin
  467. end;
  468. { To conserve data space for windows that are hidden, the WndwStats are kept
  469.   from WndwStat[MaxWndw] down, while the windows displayed are kept from
  470.   WndwStat[1] up.  So, when HideWindow is executed, the TopWndwStats are
  471.   move to the highest available index set by HLI (Hidden Level Index).  In
  472.   addition, the Window that disappeared from the screen is kept where the
  473.   previous underlay was - ULptr^. }
  474.  
  475. { =========================================================================== }
  476. { NAME: ShowWindow                                          ver 4.0, 12-12-87 }
  477. { DESCRIPTION: Shows a hidden window on the screen as the new top window.     }
  478. { PARAMETERS:  WindowName - name of the window to be shown                    }
  479. { =========================================================================== }
  480. procedure ShowWindow;  { (WindowName: WindowNames); }
  481. begin
  482. end;
  483. { ShowWindow searches WndwStat[HLI] up for WindowName.  If found, the stats
  484.   are move to WndwStat[LI] and TopWndwStat.  The remaining hidden WndwStats
  485.   are reshuffled to close up the gap.  There's no worry about overlap. }
  486.  
  487. { =========================================================================== }
  488. { NAME: MoveWindow                                          ver 4.0, 12-12-87 }
  489. { DESCRIPTION: Moves the top window on the screen.                            }
  490. { PARAMETERS:  Dir - Up, Down, Left, or Right                                 }
  491. {              NumOfChars - Number of Cols or Rows to move over               }
  492. { =========================================================================== }
  493. procedure MoveWindow;  { (Dir: DirType; NumOfChars: byte); }
  494. begin
  495. end;
  496. { MoveWindow not only allows any direction, but the number of characters to
  497.   move can also be specified.  This allows a rate-controlled movement.  In
  498.   addition, the movement is limited to the margins specified in the Margins
  499.   record which defaults to the screen limits.  Shadows for movement on the
  500.   top level are completely supported. }
  501.  
  502. { =========================================================================== }
  503. { NAME: GetLevelIndex                                       ver 4.0, 12-12-87 }
  504. { DESCRIPTION:  Scans WndwStats for first matching WindowName.  LI and        }
  505. {               below are scanned first.  Hidden windows from HLI up are      }
  506. {               scanned last.  If no match is found, result is zero.          }
  507. { PARAMETERS:   WindowName - identification name of window to be found        }
  508. { =========================================================================== }
  509. function GetLevelIndex; { (WindowName: WindowNames): byte; }
  510. var i: byte;
  511. begin
  512.   i:=LI;
  513.   while ((i>0) and (WindowName<>WndwStat[i].WSname)) do
  514.     dec (i);
  515.   if (i=0) then
  516.     begin
  517.       i:=HLI;
  518.       while ((i<=MaxWndw) and (WindowName<>WndwStat[i].WSname)) do
  519.         inc (i);
  520.     end;
  521.   if i>MaxWndw then i:=0;
  522.   GetLevelIndex:=i;
  523. end;
  524.  
  525. { =========================================================================== }
  526. { NAME: AccessWindow                                        ver 4.0, 12-12-87 }
  527. { DESCRIPTION:  Accessess a window covered by other windows to become the     }
  528. {               the new top window.                                           }
  529. { PARAMETERS:   WindowName - identification name of window to be accessed     }
  530. { =========================================================================== }
  531. procedure AccessWindow; { (WindowName: WindowNames); }
  532. begin
  533. end;
  534. { AccessWindow pulls out any window underneath the top level window, and if
  535.   the window is hidden, AccessWindow will simply use the ShowWindow
  536.   procedure.  The WndwStats and the heap memory are relocated and reshuffled.
  537.   If ZoomMode was set when the window was created with MakeWindow, it will
  538.   also be accessed with a zoom effect.  If a shadow mode is set, that window
  539.   will appear correctly, but if a window between the accessed level and the
  540.   top level has a shadow, the gaps will not be correctly.  Hopefully, you
  541.   will see that lots of shadows gets messy anyway.  I would suggest that
  542.   you use a shadow only on the top level to give it that off-the-screen
  543.   appearance. }
  544.  
  545. END.